package SmartControl_Mediator_22.Equipment;

import SmartControl_Mediator_22.Device;
import SmartControl_Mediator_22.SmartMediator;

public class Alarm extends Device {

    private final SmartMediator smartMediator;

    public Alarm(SmartMediator smartMediator) {
        this.smartMediator = smartMediator;
    }

    @Override
    public void on() {
        System.out.println("Alarm is ON,notify mediator");
        smartMediator.notify(this, "Alarm is ON");
    }

    @Override
    public void off() {
        System.out.println("Alarm is OFF");
        smartMediator.notify(this, "Alarm is OFF");
    }
}
